package NewOOP.prot.many;

public class TestAnimal {

    public static void walk(IRunning running){  //只关心是否是IRunning标准
        running.run();
    }
    public static void swim(ISwimming swimming) {
        swimming.swimming();
    }
    public static void fly(IFlying flying) {  //只关心是否是IFlying标准
        flying.fly();
    }
    public static void main(String[] args) {
        walk(new Cat("小猫"));//walk
        walk(new Duck("唐老鸭"));
        fly(new Duck("唐老鸭二号"));


    }
}
